#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int is_left_move(char* ch1,char* ch2) {
	int len1 = sizeof(ch1);
	int len2 = sizeof(ch2);
	if (len1 != len2) {
		return 0;
	}
	strncat(ch1, ch1, len1);
	if (strstr(ch1, ch2) != NULL) {
		return 1;
	}
	else {
		return 0;
	}

}
int main() {
	char ch1[20] = "abcdef";
	char ch2[] = "bcdefa";
	int ret = is_left_move(ch1, ch2);
	if (ret == 1) {
		printf("YES\n");
	}
	else {
		printf("NO\n");
	}
}